/**
 * Created by wingsfrog on 2017/6/23.
 */
import {Injectable} from "@angular/core";
import {HttpUtils} from "../utils/http.utils";
import {USER} from "../service/user.service";
import {ParamsModel, PageParam} from "../model/params.model";

@Injectable()
export class COMPLAINT {
  complaintCategoryApi : string = '/dictionary/code/complaint_category';
  complaintApi: string = '/complaint';

  constructor(private api: HttpUtils,private USER:USER) {

  }

  getComplaintCategory(param:any,success:any){
    let pm = new ParamsModel(this.USER);
    pm.url = this.complaintCategoryApi;
    pm.reqestData = param;
    pm.succCallback = success;
    this.api.get(pm);
  }
  postComplaint(param:any,success:any){
    let pm = new ParamsModel(this.USER);
    pm.url = this.complaintApi;
    pm.reqestData = param;
    pm.succCallback = success;
    this.api.post(pm);
  }
  getComplaint(success:any,page?:PageParam){
    let pm = new ParamsModel(this.USER);
    pm.url = this.complaintApi;
    pm.reqestData = page;
    pm.succCallback = success;
    this.api.get(pm);
  }

}
